export function noMultipleClicks(methods, info, info1) {
	// methods是需要点击后需要执行的函数， info是点击需要传的参数
	let that = this;
	if (that.noClick) {
		// 第一次点击
		that.noClick = false;
		if (info && info !== '' || info1 && info1 !== '') {
			// info是执行函数需要传的参数
			methods(info, info1);
		} else {
			methods();
		}
		setTimeout(() => {
			that.noClick = true;
		}, 2000)
	} else {
		// 这里是重复点击的判断
	}
}
// 页面埋点自定义消息
export function ymmdBtn(btnCode, data) {
	const {
		aplus_queue
	} = window;
	aplus_queue.push({
		action: 'aplus.record',
		arguments: [btnCode, 'CLK', data]
	});
}

// 页面埋点
export function ymmd(data) {
	console.log(data, 'data')
	const {
		aplus_queue
	} = window;
	aplus_queue.push({
		action: 'aplus.sendPV',
		arguments: [{
			is_auto: false
		}, data]
	});
}
export function ts(tit) {
	uni.showToast({
		title: tit,
		icon: 'none',
		duration: 2000
	})
}
export function jumpComPage(res1) {
	
	var url = "";
	if (res1.data.page == "form") {
		url = "/pagesA/form/index"
	} else if (res1.data.page == "list") {
		url = "/pagesC/list/index"
	} else if (res1.data.page == "sure1") {
		url = "/pagesA/form/index"
	} else if (res1.data.page == "sure2") {
		url = "/pagesA/form/index"
	} else if (res1.data.page == "shop") {
		url = "/pagesA/form/index"
	} else if (res1.data.page == "form_match") {
		let data = encodeURIComponent(JSON.stringify(res1.data.userinfo));
		url = `/pagesA/form/indexOld?type=1&userInfo=${data}`;
	} else if (res1.data.page == "end") {
		url = `/pagesE/result/index`;
	}
	if (res1.data.page == "form") {
		uni.redirectTo({
			url: url
		})
	} else {
		if (url.length > 0) {
			uni.navigateTo({
				url: url
			})
		}
	}
	// console.log(url, '')

}